/* Layout */
import Layout from '@/layout'
// import { Message } from 'element-ui'

// 动态路由
export const asyncRoutes = [
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    meta: { title: '首页', icon: 'nav_home' },
    children: [{
      path: 'home',
      name: 'Home',
      component: () => import('@/views/home/index'),
      meta: { title: '首页', icon: 'nav_home' }
    }]
  },
  {
    path: '/profile',
    component: Layout,
    redirect: '/profile/index',
    hidden: true,
    children: [
      {
        path: 'index',
        component: () => import('@/views/profile/index'),
        name: 'Profile',
        meta: { title: '个人中心', icon: 'user' }
      }
    ]
  },
  {
    path: '/venueList',
    component: Layout,
    redirect: '/venueList/venueList',
    meta: { title: '场馆列表', icon: 'nav_changguan', serveName: 'VenueList' },
    children: [{
      path: 'venueList',
      name: 'VenueList',
      component: () => import('@/views/venueList/index'),
      meta: { title: '场馆列表', icon: 'nav_changguan', serveName: 'VenueList' }
    }, {
      path: 'venueEdit',
      name: 'VenueEdit',
      hidden: true,
      component: () => import('@/views/venueEdit/index'),
      meta: { title: '编辑场馆', activeMenu: '/venueList/venueList' }
    }]
  },

  {
    path: '/vipCardList',
    component: Layout,
    redirect: '/vipCardList/vipCardList',
    meta: { title: '会员卡管理', icon: 'nav_vipcard', serveName: 'VipCardList' },
    children: [{
      path: 'vipCardList',
      name: 'VipCardList',
      component: () => import('@/views/vipCardList/index'),
      meta: { title: '会员卡管理', icon: 'nav_vipcard', serveName: 'VipCardList' }
    },
    {
      path: 'vipCardAdd',
      name: 'VipCardAdd',
      hidden: true,
      component: () => import('@/views/vipCardList/vipCardAdd/index'),
      meta: { title: '新增会员卡' }
    },
    {
      path: 'vipCardAdd',
      name: 'VipCardEdit',
      hidden: true,
      component: () => import('@/views/vipCardList/vipCardAdd/index'),
      meta: { title: '编辑会员卡' }
    }]
  },
  {
    path: '/marketing',
    component: Layout,
    redirect: '/marketing/marketing',
    meta: { title: '营销政策', icon: 'nav_zhengce', serveName: 'Marketing' },
    children: [
      {
        path: 'marketing',
        name: 'Marketing',
        component: () => import('@/views/marketing/index'),
        meta: { title: '营销政策', icon: 'nav_zhengce', serveName: 'MarketingList' }
      },
      {
        path: 'marketAdd',
        name: 'MarketAdd',
        hidden: true,
        component: () => import('@/views/marketing/marketAdd/index'),
        meta: { title: '新增政策', icon: 'nav_zhengce' }
      }
    ]
  },
  {
    path: '/coupon',
    component: Layout,
    redirect: '/coupon/coupon',
    meta: { title: '优惠券', icon: 'nav_youhuiquan', serveName: 'Coupon' },
    children: [{
      path: 'coupon',
      name: 'Coupon',
      component: () => import('@/views/coupon/index'),
      meta: { title: '优惠券', icon: 'nav_youhuiquan', serveName: 'Coupon' }
    }, {
      path: 'couponAdd',
      name: 'CouponAdd',
      hidden: true,
      component: () => import('@/views/couponAdd/index'),
      meta: { title: '新增优惠券', activeMenu: '/Coupon/CouponAdd' }
    }]
  },
  // {
  //   path: '/devicej',
  //   component: Layout,
  //   redirect: '/devicej/devicej',
  //   meta: { title: '人流分析', icon: 'nav_youhuiquan' },
  //   children: []
  // },
  {
    path: '/combo',
    component: Layout,
    redirect: '/combo/combo',
    meta: { title: '套餐配置', icon: 'nav_taocan', serveName: 'Combo' },
    children: [{
      path: 'combo',
      name: 'Combo',
      component: () => import('@/views/combo/index'),
      meta: { title: '套餐配置', icon: 'nav_taocan', serveName: 'Combo' }
    }, {
      path: 'comboAdd',
      name: 'ComboAdd',
      hidden: true,
      component: () => import('@/views/comboAdd/index'),
      meta: { title: '新增套餐', icon: 'nav_taocan' }
    }]
  },

  {
    path: '/options',
    component: Layout,
    redirect: '/options/optionDefault',
    meta: { title: '配置管理', icon: 'nav_peizhi', serveName: 'options' },
    children: [{
      path: 'optionDefault',
      name: 'OptionDefault',
      component: () => import('@/views/options/optionDefault/index'),
      meta: { title: '通用配置', serveName: 'OptionDefault' }
    }, {
      path: 'optionVip',
      name: 'OptionVip',
      component: () => import('@/views/options/optionVip/index'),
      meta: { title: '会员配置', serveName: 'OptionVip' }
    }, {
      path: 'homePageList',
      name: 'HomePageList',
      component: () => import('@/views/options/homePage/index'),
      meta: { title: '首页广告' }
    }, {
      path: 'homePageEdit',
      name: 'HomePageEdit',
      hidden: true,
      component: () => import('@/views/options/homePage/edit.vue'),
      meta: { title: '新增首页广告' }
    }, {
      path: 'optionPay',
      name: 'OptionPay',
      hidden: true,
      component: () => import('@/views/options/optionPay/index'),
      meta: { title: '支付参数配置', serveName: 'OptionPay' }
    },
    // {
    //   path: 'elecInvoiceConfig',
    //   name: 'ElecInvoiceConfig',
    //   component: () => import('@/views/options/elecInvoiceConfig/index'),
    //   meta: { title: '电子发票配置', serveName: 'ElecInvoiceConfig' }
    // },
    {
      path: 'sportsList',
      name: 'SortsList',
      component: () => import('@/views/options/sports/index'),
      meta: { title: '运动知识配置', serveName: 'SortsList' }
    }, {
      path: 'sortsListEdit',
      name: 'SortsListEdit',
      hidden: true,
      component: () => import('@/views/options/sports/edit.vue'),
      meta: { title: '新增运动知识' }
    }, {
      path: 'noviceHelpList',
      name: 'NoviceHelpList',
      component: () => import('@/views/options/noviceHelp/index'),
      meta: { title: '常见问题配置', serveName: 'NoviceHelp' }
    }, {
      path: 'noviceHelpEdit',
      name: 'NoviceHelpEdit',
      hidden: true,
      component: () => import('@/views/options/noviceHelp/edit.vue'),
      meta: { title: '新增常见问题' }
    }, {
      path: 'integralRule',
      name: 'IntegralRule',
      component: () => import('@/views/options/integralRule/index'),
      meta: { title: '积分规则配置', serveName: 'IntegralRule' }
    }, {
      path: 'dictValue',
      name: 'DictValue',
      component: () => import('@/views/options/dictValue/index'),
      meta: { title: '字典值配置', serveName: 'DictionaryList' }
    }, {
      path: 'optionsWonderful',
      name: 'OptionsWonderful',
      hidden: true,
      component: () => import('@/views/options/optionsWonderful/index'),
      meta: { title: '精彩瞬间', serveName: 'OptionsWonderful' }
    }
    ]
  },

  {
    path: '/accountOptions',
    component: Layout,
    redirect: '/accountOptions/role',
    meta: { title: '账号配置', icon: 'nav_zhanghao', serveName: 'Role' },
    children: [{
      path: 'roleList',
      name: 'RoleList',
      component: () => import('@/views/role/roleList/index'),
      meta: { title: '角色列表', serveName: 'RoleList' }
    }, {
      path: 'roleBind',
      name: 'RoleBind',
      hidden: true,
      component: () => import('@/views/role/roleBind/index'),
      meta: { title: '分配权限', activeMenu: '/accountOptions/role/roleList' }
    },
    // {
    //   path: 'roleBind',
    //   name: 'RoleBind',
    //   hidden: true,
    //   component: () => import('@/views/roleBind/index'),
    //   meta: { title: '分配权限', activeMenu: '/accountOptions/roleList', serveName: 'role' }
    //   // beforeEnter: (to, from, next) => {
    //   //   if (to.meta.buttons.includes('bind')) {
    //   //     next()
    //   //   } else {
    //   //     Message.error('没有权限')
    //   //     return false
    //   //   }
    //   // }
    // },
    {
      path: 'accountList',
      name: 'AccountList',
      component: () => import('@/views/accountList/index'),
      meta: { title: '账号列表', serveName: 'AccountList' }
    }]
  },

  {
    path: '/notice',
    component: Layout,
    redirect: '/notice/noticeSystem',
    meta: { title: '通知公告', icon: 'nav_tongzhi', serveName: 'Notice' },
    children: [{
      path: 'noticeSystem',
      name: 'NoticeSystem',
      component: () => import('@/views/notice/noticeSystem/index'),
      meta: { title: '员工通知', serveName: 'NoticeSystem' }
    }, {
      path: 'noticeVenue',
      name: 'NoticeVenue',
      component: () => import('@/views/notice/noticeVenue/index'),
      meta: { title: '会员公告', serveName: 'NoticeVenue' }
    }, {
      path: 'noticeFeedback',
      name: 'NoticeFeedback',
      component: () => import('@/views/notice/noticeFeedback/index'),
      meta: { title: '意见反馈', serveName: 'NoticeFeedback' }
    }]
  },
  {
    path: '/statistics',
    component: Layout,
    redirect: '/statistics/businessStatistics',
    meta: { title: '统计分析', icon: 'nav_tongji', serveName: 'statistics' },
    children: [{
      path: 'businessStatistics',
      name: 'BusinessStatistics',
      component: () => import('@/views/statistics/businessStatistics/statistic/index'),
      meta: { title: '营业结算统计', serveName: 'BusinessStatistics' }
    }, {
      path: 'businessStatisticsEcharts',
      name: 'BusinessStatisticssEcharts',
      component: () => import('@/views/statistics/businessStatistics/charts/echarts'),
      meta: { title: '营业结算图表统计', serveName: 'BusinessStatisticssEcharts' }
    }, {
      path: 'businessStatisticsSummary',
      name: 'BusinessStatisticssSummary',
      component: () => import('@/views/statistics/businessStatistics/summary/summary'),
      meta: { title: '营业分类汇总', serveName: 'BusinessStatisticssSummary' }
    }, {
      path: 'transactionRecord',
      name: 'TransactionRecord',
      component: () => import('@/views/statistics/memberStatistics'),
      meta: { title: '会员相关统计', serveName: 'TransactionRecord' }
    }, {
      path: 'setmealSales',
      name: 'SetmealSales',
      component: () => import('@/views/statistics/setmealStatistics/index'),
      meta: { title: '套餐相关统计', serveName: 'SetmealSales' }
    },
    // {
    //   path: 'setmealDetail',
    //   name: 'SetmealDetail',
    //   component: () => import('@/views/statistics/setmealStatistics/setmealDetail/index'),
    //   meta: { title: '套餐售卖明细', serveName: 'SetmealDetail' }
    // },
    {
      path: 'productDistribution',
      name: 'ProductDistribution',
      component: () => import('@/views/statistics/productDistribution/index'),
      meta: { title: '产品销售明细', serveName: 'CourseAndSite' }
    }, {
      path: 'ticketSales',
      name: 'TicketSales',
      component: () => import('@/views/statistics/ticketStatistics/index'),
      meta: { title: '门票相关统计', serveName: 'TicketSales' }
    },
    // {
    //   path: 'ticketDetail',
    //   name: 'TicketDetail',
    //   component: () => import('@/views/statistics/ticketStatistics/ticketDetail/index'),
    //   meta: { title: '门票售卖明细', serveName: 'TicketDetail' }
    // },
    {
      path: 'commoditySales',
      name: 'CommoditySales',
      component: () => import('@/views/statistics/commodityStatistics/index'),
      meta: { title: '商品相关统计', serveName: 'CommoditySales' }
    },
    // {
    //   path: 'commodityDetail',
    //   name: 'CommodityDetail',
    //   component: () => import('@/views/statistics/commodityStatistics/commodityDetail/index'),
    //   meta: { title: '商品售卖明细', serveName: 'CommodityDetail' }
    // },
    {
      path: 'curriculumSales',
      name: 'CurriculumRela',
      component: () => import('@/views/statistics/curriculumStatistics/index'),
      meta: { title: '课程相关统计', serveName: 'CurriculumRela' }
    }, {
      path: 'activitySales',
      name: 'ActivityStatistics',
      component: () => import('@/views/statistics/activityStatistics/index'),
      meta: { title: '活动相关统计', serveName: 'ActivityStatistics' }
    },
    // {
    //   path: 'siteUseAnalysis',
    //   name: 'SiteUseAnalysis',
    //   component: () => import('@/views/statistics/fieldStatistics/siteUseAnalysis/index'),
    //   meta: { title: '场地使用分析', serveName: 'FieldStatistics' }
    // },
    {
      path: 'fieldStatisticsDetail',
      name: 'FieldStatisticsDetail',
      component: () => import('@/views/statistics/fieldStatistics/fieldStatisticsDetail/index'),
      meta: { title: '订场相关统计', serveName: 'FieldStatisticsDetail' }
    }, {
      path: 'devicej',
      name: 'Devicj',
      component: () => import('@/views/devicej/index'),
      meta: { title: '人流分析', serveName: 'Devicj' }
    },
    {
      path: 'devicejs',
      name: 'Devicjs',
      component: () => import('@/views/devicej/echarts'),
      hidden: true,
      meta: { title: '人流分析图表统计' }
    }]
  },
  {
    path: '/logmanager',
    component: Layout,
    redirect: '/logmanager/loginlog',
    meta: { title: '日志管理', icon: 'nav_rizhiguanli', serveName: 'Logmanager' },
    children: [{
      path: 'loginlog',
      name: 'Loginlog',
      component: () => import('@/views/logmanager/loginlog/index'),
      meta: { title: '登录日志', serveName: 'Loginlog' }
    }, {
      path: 'operatelog',
      name: 'Operatelog',
      component: () => import('@/views/logmanager/operatelog/index'),
      meta: { title: '操作日志', serveName: 'Operatelog' }
    }]
  }, {
    path: '/application',
    component: Layout,
    redirect: '/application/applicationCenter',
    meta: { title: '应用', icon: 'nav_yingyong', serveName: 'ApplicationShop' },
    children: [
      {
        path: 'applicationCenter',
        name: 'ApplicationCenter',
        component: () => import('@/views/application/applicationCenter/index'),
        meta: { title: '应用中心', serveName: 'ApplicationCenterShop' }
      },
      {
        path: 'shareModule',
        name: 'ShareModule',
        component: () => import('@/views/application/share/index'),
        meta: { title: '分享邀请好友', serveName: 'ShareModule' },
        hidden: true
      },
      {
        path: 'taskAdd',
        name: 'TaskAdd',
        component: () => import('@/views/application/share/taskAdmin/components/taskAdd'),
        meta: { title: '新增任务' },
        hidden: true
      },
      {
        path: 'taskDetail',
        name: 'TaskDetail',
        component: () => import('@/views/application/share/taskAdmin/components/taskDetail.vue'),
        meta: { title: '查看任务' },
        hidden: true
      },
      {
        path: 'sharePeople',
        name: 'SharePeople',
        component: () => import('@/views/application/share/taskAdmin/components/people.vue'),
        meta: { title: '任务人员', serveName: 'SharePeople' },
        hidden: true
      },
      {
        path: 'shareOrderDetail',
        name: 'ShareOrderDetail',
        component: () => import('@/views/application/share/taskOrder/detail.vue'),
        meta: { title: '返佣订单明细' },
        hidden: true
      },
      {
        path: 'ElecInvoiceConfig',
        name: 'ElecInvoiceConfig',
        component: () => import('@/views/application/merchantInfo/index.vue'),
        meta: { title: '电子发票', serveName: 'ElecInvoiceConfig' },
        hidden: true
      },
      {
        path: 'miniFinish',
        name: 'MiniFinish',
        component: () => import('@/views/application/miniFinish'),
        meta: { title: '小程序装修', serveName: 'MiniFinish' },
        hidden: true
      }
    ]
  }
  //  {
  //   path: '/marketingManagement',
  //   component: Layout,
  //   redirect: '/marketingManagement/marketingRotation',
  //   meta: { title: '营销管理', icon: 'nav_tongzhi' },
  //   children: [{
  //     path: 'marketingRotation',
  //     name: 'MarketingRotation',
  //     component: () => import('@/views/marketingRotation/index'),
  //     meta: { title: '营销管理', serveName: 'marketingRotation' }
  //   }]
  // }
]
